package org.jeecg.modules.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.biz.entity.EventBet;

import java.util.Date;

/**
 *
 * 认筹任务 mapper 接口
 *
 */
public interface EventBetMapper extends BaseMapper<EventBet> {
    @Select("select * from event_bet order by timestamp desc limit 0,1")
    EventBet getLatestOne();

    IPage<EventBet> list4IsSettle(
            IPage<EventBet> page ,
            @Param("timestamp_begin")String timestamp_begin,
            @Param("timestamp_end") String timestamp_end
    );

    @Update("update event_bet set is_settle = 1 where caller = #{caller} and date = #{date}")
    boolean updateIsSettleByCallerAndDate(@Param("caller") String caller, @Param("date")String date);
}
